<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/


Route::get('/', function () {
    return redirect()->route('topics.index');
})->name('home');

Auth::routes(['verify' => true]);

Route::resource('users', \App\Http\Controllers\UsersController::class, ['only' => ['show', 'update', 'edit']]);

Route::resource('categories', \App\Http\Controllers\CategoriesController::class, ['only' => ['show']]);

Route::post('topics/upload/image', [\App\Http\Controllers\TopicsController::class, 'uploadImage'])->name('topics.upload_image');

Route::resource('topics', \App\Http\Controllers\TopicsController::class, ['only' => ['index', 'create', 'store', 'update', 'edit', 'destroy']]);

Route::get('topics/{topic}/{slug?}', [\App\Http\Controllers\TopicsController::class, 'show'])->name('topics.show');

Route::resource('replies', \App\Http\Controllers\RepliesController::class, ['only' => ['store', 'destroy']]);

Route::resource('notifications', \App\Http\Controllers\NotificationsController::class, ['only' => ['index']]);

Route::resource('tags', \App\Http\Controllers\TagsController::class, ['only' => ['show']]);

Route::get('search', [\App\Http\Controllers\TopicsController::class, 'search'])->name('search');
